import http from "@/utils/request"

declare global {
    interface productParam {
        product_id?:string;
        category_id?: string;
        categoryName:string;
        categoryImgurl:string
    }
}

//展示商品类目
export let getCategory = () => http.get("/category/getCategory")

//展示商品列表
export let getProduct = (params: productParam) => http.get("/product/get_product", {
    params
})

//添加类目
export const addCategory = (categoryName:productParam, categoryImgurl:productParam) => http.post('/category/addCategory', {
    categoryName,
    categoryImgurl
})

export let addProduct = (params: productParam) => http.get("/product/add_product", {
    params
})
